<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/maa.tld" prefix="m" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setLocale value="${language}"/>
<fmt:bundle basename="messages" prefix="main.">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="${pageContext.servletContext.contextPath}/static/yin.ico">
    <title><fmt:message key="title"/></title>
    <link href="${pageContext.servletContext.contextPath}/static/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/main.css" rel="stylesheet">
    <style id="holderjs-style" type="text/css"></style>
</head>

<body>
<div class="navbar-wrapper">
    <div class="container-fluid">
        <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/maa/do?action=main"> <img
                            src="${pageContext.servletContext.contextPath}/static/ics.png"/>Silver Dragon</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <c:choose>
                            <c:when test="${not empty user and user.role == 'CLIENT'}">
                                <li><a><strong><fmt:message key="greeting"/> ${user.name} ${user.surname}!</strong></a>
                                </li>
                                <li><a href="/maa/do?action=account"><fmt:message key="account"/></a></li>
                                <li>
                                    <form action="/maa/do" method="post">
                                        <input type="hidden" name="action" value="logout">
                                        <input class="btn btn-default" type="submit"
                                               value="<fmt:message key="logout"/>"/>
                                    </form>
                                </li>
                                <m:language/>
                            </c:when>
                            <c:when test="${not empty user and user.role == 'MENTOR'}">
                                <li><a><strong><fmt:message key="greeting"/> ${user.name} ${user.surname}!</strong></a>
                                </li>
                                <li><a href="/maa/do?action=account"><fmt:message key="account"/></a></li>
                                <li>
                                    <form action="/maa/do" method="post">
                                        <input type="hidden" name="action" value="logout">
                                        <input class="btn btn-default" type="submit"
                                               value="<fmt:message key="logout"/>"/>
                                    </form>
                                </li>
                                <m:language/>
                            </c:when>
                            <c:when test="${not empty user and user.role == 'ADMIN'}">
                                <li><a><strong><fmt:message key="greeting"/> ${user.name} ${user.surname}!</strong></a>
                                </li>
                                <li><a href="/maa/do?action=admin-cabinet"><fmt:message key="cabinet"/></a></li>
                                <li>
                                    <form action="/maa/do" method="post">
                                        <input type="hidden" name="action" value="logout">
                                        <input class="btn btn-default" type="submit"
                                               value="<fmt:message key="logout"/>"/>
                                    </form>
                                </li>
                                <m:language/>
                            </c:when>
                            <c:otherwise>
                                <li><a href="/maa/do?action=login-form"><fmt:message key="login"/></a></li>
                                <li><a href="/maa/do?action=registration-form"><fmt:message key="register"/></a></li>
                                <m:language/>
                            </c:otherwise>
                        </c:choose>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="myCarousel" class="carousel slide" data-ride="carousel">
    <ol class="carousel-indicators">
        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
        <li data-target="#myCarousel" data-slide-to="1" class=""></li>
        <li data-target="#myCarousel" data-slide-to="2" class=""></li>
    </ol>
    <div class="carousel-inner">
        <div class="item active">
            <img alt="First slide" src="${pageContext.servletContext.contextPath}/static/main.jpg"/>

            <div class="container">
                <div class="carousel-caption">
                    <h3><fmt:message key="welcome"/></h3>
                </div>
            </div>
        </div>
        <div class="item">
            <img alt="Second slide"
                 src="${pageContext.servletContext.contextPath}/static/leg.jpg">

            <div class="container">
                <div class="carousel-caption">
                    <h3><fmt:message key="welcome"/></h3>
                </div>
            </div>
        </div>
        <div class="item">
            <img src="${pageContext.servletContext.contextPath}/static/mid.jpg" alt="Third
            slide">

            <div class="container">
                <div class="carousel-caption">
                    <h3><fmt:message key="welcome"/></h3>
                </div>
            </div>
        </div>
    </div>
    <a class="left carousel-control" href="/maa/do?action=main#myCarousel" data-slide="prev"><span
            class="glyphicon glyphicon-chevron-left"></span></a>
    <a class="right carousel-control" href="#myCarousel" data-slide="next"><span
            class="glyphicon glyphicon-chevron-right"></span></a>
</div>

<div class="container">
    <div class="container marketing">
        <div class="row">
            <div class="col-lg-4">
                <form action="/maa/do" method="get">

                    <img class="img-rounded"
                         src="${pageContext.servletContext.contextPath}/static/pips.jpg"
                         style="width: 280px; height: 200px;">

                    <h2><fmt:message key="join"/></h2>

                    <p><fmt:message key="joinmess"/></p>

                    <p><input type="hidden" name="action" value="courses"/>
                        <input class="btn btn-default" type="submit" value="<fmt:message key="viewcourses"/>"/></p>

                </form>
            </div>
            <div class="col-lg-4">
                <form action="/maa/do" method="get">

                    <img class="img-circle"
                         src="${pageContext.servletContext.contextPath}/static/mid.jpg"
                         style="width: 240px; height: 200px;">

                    <h2><fmt:message key="discover"/></h2>

                    <p><fmt:message key="discovermess"/></p>

                    <c:if test="${user.role != 'ADMIN' and user.role!='CLIENT' and user.role!='MENTOR'}">
                    <p><input type="hidden" name="action" value="registration-form"/>
                        <input class="btn btn-default" type="submit" value="<fmt:message key="register"/>"/></p>
                    </c:if>
                </form>
            </div>
            <div class="col-lg-4">
                <form action="/maa/do" method="get">
                    <img class="img-rounded"
                         src="${pageContext.servletContext.contextPath}/static/mentor.jpg"
                         style="width: 280px; height: 200px;">

                    <h2><fmt:message key="learn"/></h2>

                    <p><fmt:message key="learnmess"/></p>

                    <p><input type="hidden" name="action" value="mentors"/>
                        <input class="btn btn-default" type="submit" value="<fmt:message key="viewmentors"/>"/></p>
                </form>
            </div>
        </div>
        <div class="footer">
            <p>&copy; Martial Arts Academy</p>
        </div>
    </div>
</div>

<%--<script src="./Carousel Template for Bootstrap_files/jquery.min.js"></script>--%>
<%--<script src="./Carousel Template for Bootstrap_files/bootstrap.min.js"></script>--%>
<%--<script src="./Carousel Template for Bootstrap_files/docs.min.js"></script>--%>

</body>
</html>

</fmt:bundle>
